package com.woniuxy.myprojectai;

import com.alibaba.cloud.ai.dashscope.chat.DashScopeChatOptions;
import com.woniuxy.ai.WeatherAsk;
import org.junit.jupiter.api.Test;
import org.springframework.ai.chat.client.ChatClient;
import org.springframework.ai.chat.client.DefaultChatClientBuilder;
import org.springframework.ai.chat.client.advisor.SimpleLoggerAdvisor;
import org.springframework.ai.chat.model.ChatModel;
import org.springframework.ai.model.tool.autoconfigure.ToolCallingProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import static com.fasterxml.jackson.databind.type.LogicalType.Map;

/**
 * @Author: 马宇航
 * @Todo: TODO
 * @DateTime: 25/09/09/星期二 11:48
 * @Component: 成都蜗牛学苑
 **/
@SpringBootTest
public class AlibabaToolCalling {

    @Autowired
    ChatClient client;

    @Test
    public void test(){
        ChatClient.CallResponseSpec call = client
                .prompt("现在几点了？上海什么天气？")
//                .tools(new WeatherAsk()) //自己开发的方式也是这么写的
//                .toolNames("WeatherAsk") //为后面MCP做铺垫
                .call();
        System.out.println(call.content());
    }
}
